package com.itheima.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;

import lombok.Data;

/**
 * 学员表
 *
 * @TableName student
 */
@TableName(value = "student")
@Data
public class Student {
    /**
     * ID,主键
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 姓名
     */
    private String name;

    /**
     * 学号
     */
    private String no;

    /**
     * 性别, 1: 男, 2: 女
     */
    private Integer gender;

    /**
     * 手机号
     */
    private String phone;

    /**
     * 身份证号
     */

    private String idCard;

    /**
     * 是否来自于院校, 1:是, 0:否
     */
    private Integer isCollege;

    /**
     * 联系地址
     */
    private String address;

    /**
     * 最高学历, 1:初中, 2:高中, 3:大专, 4:本科, 5:硕士, 6:博士
     */
    private Integer degree;

    /**
     * 毕业时间
     */
    private LocalDate graduationDate;

    /**
     * 班级ID, 关联班级表ID
     */
    private Integer clazzId;

    /**
     * 违纪次数
     */
    private Integer violationCount;

    /**
     * 违纪扣分
     */
    private Integer violationScore;

    /**
     * 创建时间
     */
    private LocalDateTime createTime;

    /**
     * 修改时间
     */
    private LocalDateTime updateTime;

    private String ClazzName;//班级名称

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Student other = (Student) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
                && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
                && (this.getNo() == null ? other.getNo() == null : this.getNo().equals(other.getNo()))
                && (this.getGender() == null ? other.getGender() == null : this.getGender().equals(other.getGender()))
                && (this.getPhone() == null ? other.getPhone() == null : this.getPhone().equals(other.getPhone()))
                && (this.getIdCard() == null ? other.getIdCard() == null : this.getIdCard().equals(other.getIdCard()))
                && (this.getIsCollege() == null ? other.getIsCollege() == null : this.getIsCollege().equals(other.getIsCollege()))
                && (this.getAddress() == null ? other.getAddress() == null : this.getAddress().equals(other.getAddress()))
                && (this.getDegree() == null ? other.getDegree() == null : this.getDegree().equals(other.getDegree()))
                && (this.getGraduationDate() == null ? other.getGraduationDate() == null : this.getGraduationDate().equals(other.getGraduationDate()))
                && (this.getClazzId() == null ? other.getClazzId() == null : this.getClazzId().equals(other.getClazzId()))
                && (this.getViolationCount() == null ? other.getViolationCount() == null : this.getViolationCount().equals(other.getViolationCount()))
                && (this.getViolationScore() == null ? other.getViolationScore() == null : this.getViolationScore().equals(other.getViolationScore()))
                && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
                && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getNo() == null) ? 0 : getNo().hashCode());
        result = prime * result + ((getGender() == null) ? 0 : getGender().hashCode());
        result = prime * result + ((getPhone() == null) ? 0 : getPhone().hashCode());
        result = prime * result + ((getIdCard() == null) ? 0 : getIdCard().hashCode());
        result = prime * result + ((getIsCollege() == null) ? 0 : getIsCollege().hashCode());
        result = prime * result + ((getAddress() == null) ? 0 : getAddress().hashCode());
        result = prime * result + ((getDegree() == null) ? 0 : getDegree().hashCode());
        result = prime * result + ((getGraduationDate() == null) ? 0 : getGraduationDate().hashCode());
        result = prime * result + ((getClazzId() == null) ? 0 : getClazzId().hashCode());
        result = prime * result + ((getViolationCount() == null) ? 0 : getViolationCount().hashCode());
        result = prime * result + ((getViolationScore() == null) ? 0 : getViolationScore().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", name=").append(name);
        sb.append(", no=").append(no);
        sb.append(", gender=").append(gender);
        sb.append(", phone=").append(phone);
        sb.append(", idCard=").append(idCard);
        sb.append(", isCollege=").append(isCollege);
        sb.append(", address=").append(address);
        sb.append(", degree=").append(degree);
        sb.append(", graduationDate=").append(graduationDate);
        sb.append(", clazzId=").append(clazzId);
        sb.append(", violationCount=").append(violationCount);
        sb.append(", violationScore=").append(violationScore);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append("]");
        return sb.toString();
    }
}